package net.showcal.api.request.mobile;


import com.alibaba.fastjson.JSON;
import net.showcal.api.ApiRuleException;
import net.showcal.api.XiniuRequest;
import net.showcal.api.domain.mobile.CateComment;
import net.showcal.api.internal.util.XiniuHashMap;
import net.showcal.api.response.mobile.SyncHeatCreateResponse;

import java.util.Map;

import java.util.List;


/**
 * <p/>
 * <pre>
 * ***************************************************************
 *  Copyright (c) 2014 –苏州犀牛网络科技有限公司
 *  Title: com.xiniunet.thermalcontrol.helper.ThermalcontrolHelperImpl
 *  Description: thermalcontrol Request
 *  @since
 *  @author 顾志雄
 * ***************************************************************
 * </pre>
 */
public class SyncHeatCreateRequest implements XiniuRequest<SyncHeatCreateResponse> {
    private XiniuHashMap udfParams = new XiniuHashMap();

    /**
     * 获取API名称
     */
    @Override
    public String getApiMethodName() {
        return "thermalcontrol.syncHeat.create";
    }

    /**
     * 餐次
     */
    private Long mealsId;
    /**
     * 食物热量
     */
    private Double totalHeat;
    /**
     * 蛋白质(克)
     */
    private Double totalProtein;
    /**
     * 脂肪（克）
     */
    private Double totalFat;
    /**
     * 碳水化合物（克）
     */
    private Double totalCarbohydrate;
    /**
     * 膳食纤维（克）
     */
    private Double totalDf;
    /**
     * 实际评分值
     */
    private Double grade;
    /**
     * 是否同步完成
     */
    private Boolean isSynced;
    /**
     * 目标热量
     */
    private Double goalHeat;
    /**
     * 当餐目标蛋白质
     */
    private Double goalProtein;
    /**
     * 目标脂肪
     */
    private Double goalFat;
    /**
     * 目标碳水化合物
     */
    private Double goalCarbohydrate;
    /**
     * 目标膳食纤维
     */
    private Double goalDf;
    /**
     * 类型 1=拍照上传，2=食物选择上传
     */
    private String type;
    /**
     * 描述
     */
    private String desc;
    /**
     * 是否已评论 1=已评论，0=未评论
     */
    private String isComment;
    /**
     * 当前餐次计数 当前餐次计数
     */
    private Integer currentMealCount;
    /**
     * 同步行记录
     */
    private List<SyncHeatDetailCreateRequest> detail;
    /**
     *
     */
    private List<CateComment> cateComment;
    /**
     *
     */
    private List<MealsPictureCreateRequest> mealsPicture;

    public Long getMealsId() {
        return mealsId;
    }

    public void setMealsId(Long mealsId) {
        this.mealsId = mealsId;
    }

    public Double getTotalHeat() {
        return totalHeat;
    }

    public void setTotalHeat(Double totalHeat) {
        this.totalHeat = totalHeat;
    }

    public Double getTotalProtein() {
        return totalProtein;
    }

    public void setTotalProtein(Double totalProtein) {
        this.totalProtein = totalProtein;
    }

    public Double getTotalFat() {
        return totalFat;
    }

    public void setTotalFat(Double totalFat) {
        this.totalFat = totalFat;
    }

    public Double getTotalCarbohydrate() {
        return totalCarbohydrate;
    }

    public void setTotalCarbohydrate(Double totalCarbohydrate) {
        this.totalCarbohydrate = totalCarbohydrate;
    }

    public Double getTotalDf() {
        return totalDf;
    }

    public void setTotalDf(Double totalDf) {
        this.totalDf = totalDf;
    }

    public Double getGrade() {
        return grade;
    }

    public void setGrade(Double grade) {
        this.grade = grade;
    }

    public Boolean getIsSynced() {
        return isSynced;
    }

    public void setIsSynced(Boolean isSynced) {
        this.isSynced = isSynced;
    }

    public Double getGoalHeat() {
        return goalHeat;
    }

    public void setGoalHeat(Double goalHeat) {
        this.goalHeat = goalHeat;
    }

    public Double getGoalProtein() {
        return goalProtein;
    }

    public void setGoalProtein(Double goalProtein) {
        this.goalProtein = goalProtein;
    }

    public Double getGoalFat() {
        return goalFat;
    }

    public void setGoalFat(Double goalFat) {
        this.goalFat = goalFat;
    }

    public Double getGoalCarbohydrate() {
        return goalCarbohydrate;
    }

    public void setGoalCarbohydrate(Double goalCarbohydrate) {
        this.goalCarbohydrate = goalCarbohydrate;
    }

    public Double getGoalDf() {
        return goalDf;
    }

    public void setGoalDf(Double goalDf) {
        this.goalDf = goalDf;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public String getIsComment() {
        return isComment;
    }

    public void setIsComment(String isComment) {
        this.isComment = isComment;
    }

    public Integer getCurrentMealCount() {
        return currentMealCount;
    }

    public void setCurrentMealCount(Integer currentMealCount) {
        this.currentMealCount = currentMealCount;
    }

    public List<SyncHeatDetailCreateRequest> getDetail() {
        return detail;
    }

    public void setDetail(List<SyncHeatDetailCreateRequest> detail) {
        this.detail = detail;
    }


    public List<MealsPictureCreateRequest> getMealsPicture() {
        return mealsPicture;
    }

    public void setMealsPicture(List<MealsPictureCreateRequest> mealsPicture) {
        this.mealsPicture = mealsPicture;
    }

    public List<CateComment> getCateComment() {
        return cateComment;
    }

    public void setCateComment(List<CateComment> cateComment) {
        this.cateComment = cateComment;
    }

    @Override
    public Map<String, String> getTextParams() {
        XiniuHashMap txtParams = new XiniuHashMap();
        txtParams.put("mealsId", this.mealsId);
        txtParams.put("totalHeat", this.totalHeat);
        txtParams.put("totalProtein", this.totalProtein);
        txtParams.put("totalFat", this.totalFat);
        txtParams.put("totalCarbohydrate", this.totalCarbohydrate);
        txtParams.put("totalDf", this.totalDf);
        txtParams.put("grade", this.grade);
        txtParams.put("isSynced", this.isSynced);
        txtParams.put("goalHeat", this.goalHeat);
        txtParams.put("goalProtein", this.goalProtein);
        txtParams.put("goalFat", this.goalFat);
        txtParams.put("goalCarbohydrate", this.goalCarbohydrate);
        txtParams.put("goalDf", this.goalDf);
        txtParams.put("type", this.type);
        txtParams.put("desc", this.desc);
        txtParams.put("isComment", this.isComment);
        txtParams.put("currentMealCount", this.currentMealCount);
        if (this.detail != null && !this.detail.isEmpty()) {
            txtParams.put("detail", JSON.toJSONString(this.detail));
        }
        if (this.cateComment != null && !this.cateComment.isEmpty()) {
            txtParams.put("cateComment", JSON.toJSONString(this.cateComment));
        }
        if (this.mealsPicture != null && !this.mealsPicture.isEmpty()) {
            txtParams.put("mealsPicture", JSON.toJSONString(this.mealsPicture));
        }

        if (this.udfParams != null) {
            txtParams.putAll(this.udfParams);
        }
        return txtParams;
    }

    @Override
    public Long getTimestamp() {
        return null;
    }

    @Override
    public void setTimestamp(Long timestamp) {

    }

    @Override
    public Class getResponseClass() {
        return SyncHeatCreateResponse.class;
    }

    @Override
    public void check() throws ApiRuleException {
    }

    @Override
    public Map<String, String> getHeaderMap() {
        return null;
    }

    @Override
    public void putOtherTextParam(String key, String value) {
        this.udfParams.put(key, value);
    }
}